UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ezBi6UKQJ0UhILDVd9znCobvdwqMRMCmkyeLIb7J7VM=' 
WHERE 
  key_id = '86bc3bf08a593175fdbd50a6f804284a1ee64c1cbe74f048d4a25a60e1df5267' 
  AND (
    token = 'ezBi6UKQJ0UhILDVd9znCobvdwqMRMCmkyeLIb7J7VM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029