UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2FZE/hQXHudl7wkM1XxhclHV33iYkheb+qv3khG6Y3o=' 
WHERE 
  key_id = '280556e7a069965528799f5daac68bb30a473928b5bd5763a6a50d6c17b9e7a5' 
  AND (
    token = '2FZE/hQXHudl7wkM1XxhclHV33iYkheb+qv3khG6Y3o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022