UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4MY7fggoUnvEdtfJqOE5O1Kniz8t/0yZnNO4NgFZqQ8=' 
WHERE 
  key_id = '22520f32f01950e3043a3fd9b4ec2bc26555c8b45a06a63aa308863a1093f65a' 
  AND (
    token = '4MY7fggoUnvEdtfJqOE5O1Kniz8t/0yZnNO4NgFZqQ8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028