UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HX/uY7H0HRoT1TozVVjhyUSnJwEfnFpf1sQ3TXxiz/I=' 
WHERE 
  key_id = 'ec737a9c09d83c345babf568d0ea63e266f6685ce99b41c6c8a53ef9924502c4' 
  AND (
    token = 'HX/uY7H0HRoT1TozVVjhyUSnJwEfnFpf1sQ3TXxiz/I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038