UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vmE2zBih5HfdGi4RN3OXMXg+uUKrSFmhDO7HlJWM7H0=' 
WHERE 
  key_id = '6bcac5ce25b20245ef5fce46269dc21d4fc1032ba5e0430ee3e9faf50fc5de61' 
  AND (
    token = 'vmE2zBih5HfdGi4RN3OXMXg+uUKrSFmhDO7HlJWM7H0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050