UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'I2e53T4fVCO8PVro2QDOjNiW+gdndXlkvjOdpQUlv7I=' 
WHERE 
  key_id = 'bea33c003f6a9fa9e9fd4c098d9ead712721753ab50bb7900ff93374cf5e8cc6' 
  AND (
    token = 'I2e53T4fVCO8PVro2QDOjNiW+gdndXlkvjOdpQUlv7I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017