UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lBdd/LwaJ7gIAkzxgdVdl+IKUbbIIYLJcsJ62sgA4T8=' 
WHERE 
  key_id = '738a6ba3ef5dfee29e7ee3a7e9a6253d0be630e9757cc1bd58e93bc298049c94' 
  AND (
    token = 'lBdd/LwaJ7gIAkzxgdVdl+IKUbbIIYLJcsJ62sgA4T8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016