UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NwG3NzRhwMHhzbvzWY2V4A4lPXQo+pjnUEvZa5SURPk=' 
WHERE 
  key_id = '038b64388acbf48aeebb7a2f193ba868ceda9b3b9629eb9fb29e709d979b3add' 
  AND (
    token = 'NwG3NzRhwMHhzbvzWY2V4A4lPXQo+pjnUEvZa5SURPk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00068