UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'InuFJHkgqCC1orkCbM4IIXcyoBRml+BRriBK7EMXRG0=' 
WHERE 
  key_id = '56d4c2e3df8d9bc022459ae297a8b0f8aafc724e09bb05b7e26c10840309d21b' 
  AND (
    token = 'InuFJHkgqCC1orkCbM4IIXcyoBRml+BRriBK7EMXRG0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039