UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+HvHkvxtph1X7ir4sMrVzyZTLKvNDOJxTejobLFL7gI=' 
WHERE 
  key_id = 'b8bb63a075cb51b87b1d63aec15406e49fe73064dd733d2e83095d39631d440e' 
  AND (
    token = '+HvHkvxtph1X7ir4sMrVzyZTLKvNDOJxTejobLFL7gI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036