UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fOwSRGPZdqV10zXwDnjN0uPGc2XXDzbT+9/FGMSQYkU=' 
WHERE 
  key_id = 'a792eef84b6e8d0630d36b2e8590412fe1441a57cbf0746f81940fbb37a6c01d' 
  AND (
    token = 'fOwSRGPZdqV10zXwDnjN0uPGc2XXDzbT+9/FGMSQYkU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030