UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'W/pwzKn7TZqSQECoD5e1Z+qjL5CYlede0gwTByiUqn8=' 
WHERE 
  key_id = '72754140b2cc5266d217ee154ca83ca668601bd74cb07fc270a649ffdc73f1c4' 
  AND (
    token = 'W/pwzKn7TZqSQECoD5e1Z+qjL5CYlede0gwTByiUqn8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036