UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eNro6XQ6k2bQ67Umsh5JidpDdHl1jaeuEEMdS5dCeck=' 
WHERE 
  key_id = '80ebc395548c9528e2ed0a28a913ec1199842cdb4aed4cf8eec1e4b446af9379' 
  AND (
    token = 'eNro6XQ6k2bQ67Umsh5JidpDdHl1jaeuEEMdS5dCeck=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039