UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'z1SSqFpi1Y+C96cxnLPDitHR0M8wILF2K48lnV0G2/I=' 
WHERE 
  key_id = '99b4aa3954f662a6927eb121c1ef8bea7d897a1296d6223ea9b005a3e53f9aad' 
  AND (
    token = 'z1SSqFpi1Y+C96cxnLPDitHR0M8wILF2K48lnV0G2/I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032