UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 't3gS9bDIwpM8JJ8DyJ3WfKZNCo+5Nxj09TFzMISo7vY=' 
WHERE 
  key_id = '650db9025bf406388a0b6d13d0b19081f3704950d0a51ae7b260317404b1c903' 
  AND (
    token = 't3gS9bDIwpM8JJ8DyJ3WfKZNCo+5Nxj09TFzMISo7vY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015