UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tOshA+hCOo4LXz/bNnCd+ze4uvmSc3VjrKSBsRX/Tbs=' 
WHERE 
  key_id = '3a053ee82cf2404a4abc1a55f1f1f020b8a897c03ab32c42abc112f070211364' 
  AND (
    token = 'tOshA+hCOo4LXz/bNnCd+ze4uvmSc3VjrKSBsRX/Tbs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035