UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mU9evcAUCdeSthp4QmaajvwaL09vBH44xE+/ZEGPxwE=' 
WHERE 
  key_id = '43ada8aae167e05bcc0a4d29d9c5249cc483fbf2d2fe7ad376b0754a7e807e1d' 
  AND (
    token = 'mU9evcAUCdeSthp4QmaajvwaL09vBH44xE+/ZEGPxwE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054