UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0Tx6JvkLiVe+889uEdB0VWQ1io8lI9aQ3nbw3PwWtSU=' 
WHERE 
  key_id = '46d445fe9c5073542cb30715425fcbf5bb797b13b2ecd136f64ec392e120c56d' 
  AND (
    token = '0Tx6JvkLiVe+889uEdB0VWQ1io8lI9aQ3nbw3PwWtSU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030