UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'j9EZuk+7kvgkrX4Bm9ZIJ0qfIFE8R/pZSzsNE1jaVcA=' 
WHERE 
  key_id = '1eaabc5c2a5eb2f52e97de34bfb0027c3c232b002274050358be4e5680d9288d' 
  AND (
    token = 'j9EZuk+7kvgkrX4Bm9ZIJ0qfIFE8R/pZSzsNE1jaVcA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016