UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'F1T8sMjQovdkxN6jmh+NvMy0uJyOBTmBlZQUCDi5lms=' 
WHERE 
  key_id = 'eb5a26130f30d715bd8fac83b0a7a5d739dfddcc432bbbbfd6558f1abed41982' 
  AND (
    token = 'F1T8sMjQovdkxN6jmh+NvMy0uJyOBTmBlZQUCDi5lms=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029