UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'E/qD4mwfblaOXkiQCDRrpqw1W/Z9aaxcw0gQatKv1bY=' 
WHERE 
  key_id = 'f33119fa76d870022c5984b3eb8b378bf9d3c8b14b9279ebbfc69fee53a3301d' 
  AND (
    token = 'E/qD4mwfblaOXkiQCDRrpqw1W/Z9aaxcw0gQatKv1bY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033