UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vzdMoXqUoDCpiMLwtkeKhzwT0I1f3o6zPPWIkZO+MMg=' 
WHERE 
  key_id = '8f9c11099a3f07b5fdb56dc45948941ffb1dd499cdcbce534792561887fd7e76' 
  AND (
    token = 'vzdMoXqUoDCpiMLwtkeKhzwT0I1f3o6zPPWIkZO+MMg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045