UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DEf1shioC/gCHWSOw0oUyW15oTIhI4FlI3oil6rwx40=' 
WHERE 
  key_id = '420e1b2de7988513c809e927745e88421db748d932c47c2349161ba96162d774' 
  AND (
    token = 'DEf1shioC/gCHWSOw0oUyW15oTIhI4FlI3oil6rwx40=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032