UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NQSJ5R3RgUJv8GuD3jUHb3wI007fF03QLj/SYd1cs5Q=' 
WHERE 
  key_id = '5c03fd28b5839bd60334ddbde0b2126de45350edff4fa05942f60093a469ecd7' 
  AND (
    token = 'NQSJ5R3RgUJv8GuD3jUHb3wI007fF03QLj/SYd1cs5Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036