UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Mhqccvm7uZVYRhVQIkPjXpFPuwL9SRtRfHFDNSh3d8s=' 
WHERE 
  key_id = '97c5e8fe593abb9c9d257bd8304b159a2280a942e571a943e074fb06809f7f3e' 
  AND (
    token = 'Mhqccvm7uZVYRhVQIkPjXpFPuwL9SRtRfHFDNSh3d8s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037