UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9lEyjY8Uuxap7eDk8imwqvU/uXPd/2rRAQ8P1FL7wTY=' 
WHERE 
  key_id = '7973becb5c9394bdcd270768957ca99d48e8f29552ee545a154dc3f0e5d08c3e' 
  AND (
    token = '9lEyjY8Uuxap7eDk8imwqvU/uXPd/2rRAQ8P1FL7wTY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030