UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'D6mqE2l+qyEAIIwGG4tcL73PnLOWas9gcT2Qu2EfeTQ=' 
WHERE 
  key_id = '2acd158aa59c09edbbc20d0e035540f22d7ac27d87ddeea28fff8eac7abf77f6' 
  AND (
    token = 'D6mqE2l+qyEAIIwGG4tcL73PnLOWas9gcT2Qu2EfeTQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030